package com.mall.b2c.domain.intergral;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mall.b2c.domain.order.CartDomain;
import com.mall.common.domain.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlTransient;

/**
 * Created by xing_ on 2017/2/27.
 */
@Entity
@Table(name = "b2c_shop_cart_item")
public class ShopCartItemDomain extends BaseEntity {

    @JsonIgnore
    private CartDomain cart;//购物车
    @JsonIgnore
    private ShopProductDomain product;
    private Integer num;// 购买数量


    @ManyToOne(fetch = FetchType.LAZY)
    @XmlTransient
    public CartDomain getCart() {
        return cart;
    }

    public void setCart(CartDomain cart) {
        this.cart = cart;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @XmlTransient
    public ShopProductDomain getProduct() {
        return product;
    }

    public void setProduct(ShopProductDomain product) {
        this.product = product;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }
}
